﻿@{
    ViewBag.Title = "ListAll";
    Layout = "~/Views/Shared/_Page.cshtml";

    int currentIndex = 0;
    if (ViewBag.CurrentIndex != null)
    {
        currentIndex = ViewBag.CurrentIndex;
    }
}

<script type="text/javascript">
    var empIndex = @currentIndex;

    function showAllEmployees() {
        jQuery.ajaxSetup({ cache: false });

        var url = "/Employee/ShowPage?pageIndex=1&pageSize=10" ;

        $.post(url, function (data) {
            $("#empInfo").html(data);
        });
    }
</script>

<h2>All Employees</h2>
<p>
	<a href="/Employee/Create">Add New Employee</a>
    <!--
    &nbsp;&nbsp;
    <input type="button" onclick="showAllEmployees()" value="Show All Employees" />
    -->
</p>

<br />

<div id="empInfo">
    @Html.Partial("/Views/Controls/ctlEmpInfo.ascx")
</div>




